<template>
    <h2>你点击的次数是 {{ sum }}</h2>
    <select v-model.number="n">
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
    </select>

    <button @click="add">加</button>
    <button @click="sub">减</button>
</template>

<script lang="ts" setup>
    import { ref } from 'vue';

    let sum = ref(1)
    let n =ref(1)

    function add(){
        sum.value += n.value
    }

    function sub(){
        sum.value -= n.value
    }
</script>


<style scoped>

</style>